package com.yanqu.road.logic.activity.foxcard.game.effect;

import com.yanqu.road.entity.activity.foxcard.FoxHandCard;
import com.yanqu.road.entity.activity.foxcard.UserFoxCardShop;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;

/**
 * 获得卡的前N次和进商店的前N次刷新免费
 */
public class FoxCardEffect36 extends FoxCardEffectBase {
    @Override
    protected void effectHandle(FoxCardGameLogic gameLogic, FoxHandCard handCard) {
        UserFoxCardShop shop = gameLogic.getGameData().getShop();
        if (triggerType == eFoxCardTriggerType.ADD && handCard == null) {
            int times = Integer.valueOf(effectConfig.getParamsList().get(0));
            if (times > 0) {
                shop.setFreeTimes(times);
            }
        } else if (triggerType == eFoxCardTriggerType.SHOP_INIT) {
            int times = Integer.valueOf(effectConfig.getParamsList().get(0));
            if (times > 0) {
                shop.setFreeTimes(times);
            }
        }
    }
}
